 
<!--微信裂变邀请管理首页-->  

<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/baseui/css/amazeui.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/baseui/css/admin.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/css/style.css"/>




<!--[if (gte IE 9)|!(IE)]><!-->
	<script type="text/javascript" src="//cdn.bootcss.com/jquery/2.2.2/jquery.min.js"></script>
	<script type="text/javascript" src="//cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js"></script>
  	<script>$(function() {FastClick.attach(document.body);});</script>
<!--<![endif]-->

<!--[if lte IE 8 ]>
	<script type="text/javascript" src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
	<script type="text/javascript" src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
	<script type="text/javascript" src="__STATIC__/weixin/assets/sell/baseui/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<script type="text/javascript" src="//cdn.bootcss.com/amazeui/2.7.2/js/amazeui.min.js"></script>

<div class="am-modal am-modal-alert" tabindex="-1" id="fq_alert">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_alert_title"></div>
    <div class="am-modal-bd" id="fq_alert_info">
    </div>
    <div class="am-modal-footer">
      <span class="am-modal-btn">确定</span>
    </div>
  </div>
</div>

<div class="am-modal am-modal-confirm" tabindex="-1" id="fq_confirm">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_confirm_title"></div>
    <div class="am-modal-bd" id="fq_confirm_info"></div>
    <div class="am-modal-footer">
      <span class="am-modal-btn" data-am-modal-confirm>确定</span>
    </div>
  </div>
</div>

<div class="am-modal am-modal-confirm" tabindex="-1" id="fq_true_confirm">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_true_confirm_title"></div>
    <div class="am-modal-bd" id="fq_true_confirm_info"></div>
    <div class="am-modal-footer">
		<span class="am-modal-btn" data-am-modal-confirm>确定</span>
		<span class="am-modal-btn" data-am-modal-cancel class="cancel">取消</span>
    </div>
  </div>
</div>
<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/css/wxinvite.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/css/wxkeyword.css" />

<!--样式开始-->
<style>

    .am-pureview {
        z-index: 2000;
    }
	
	
	#replay_spinner{
		display:none;
	}
	
	
	#upload_input{
		display:none;
		
	}
	
	.cover_item {
		height: 25px;
		background-color: #000;
		opacity: 0.5;
		position:relative;
		left: 0;
		right: 0;
		bottom: 0 !important;
		z-index: 1;
		display: block;
		text-align: center;
		top:-25px;

	}
	
	.del_icon{

		 background: url(__STATIC__/weixin/assets/sell/images/base_z2b638f.png) 0 -4827px no-repeat ;
		 width: 18px;
		 height: 18px;
		 line-height:18px;
		 display: inline-block;
		 overflow: hidden;
		 margin:3px 3px 0;
		 cursor:pointer;
		 
	}
	
	
	.tips_input{
		height:150px;
	}
</style>


<!--样式结束-->
 <!-- content start -->
    <div class="admin-content change_modal">
        <div class="admin-content-body">
            <div class="am-margin-top-sm am-margin-left">
                <strong class="am-text-primary am-text-lg">邀请奖励</strong> / <small>User invite</small>
            </div>
			
			<div class="am-margin ">
				
				<div style="position: relative;top: -10px;left: 3px;margin-bottom: 5px;">
				<span class="am-icon-bullhorn" style="margin-left:-2px;"></span> 如何使用粉丝裂变（邀请奖励）功能以及使用注意事项：
				<a target="_blank" href="#">使用说明</a>
				</div>
			
				<label class="am-checkbox am-inline-block">
					<input type="checkbox" id="auto_inter" value="0" data-am-ucheck {$is_invite}>开启邀请<i class="am-icon-spinner am-icon-spin" id="replay_spinner"></i>
				</label>
			</div>
			
            <div class="am-tabs am-margin" data-am-tabs="{noSwipe: 1}">
                <ul class=" am-nav am-nav-tabs keyword_nav">
                    <li class=" am-active keylist keylist_sum"><a href="index.php?m=Admin&c=Weixin&a=wxinvite">邀请设置</a></li>
                    <li class="keylist keylist_sum"><a href="index.php?m=Admin&c=Weixin&a=wxinvitedata">具体数据</a></li>
                </ul>
                <div class="am-tabs-bd nav_content" style="touch-action: pan-y; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">

                    <div class="am-tab-panel am-fade am-active am-in">

                        <!--设置奖励规则开始-->
                        <div class="am-panel am-margin-vertical am-panel-default">
                            <div class="am-panel-hd am-cf" data-am-collapse="{target: '#collapse-panel-1'}">
                                设置奖励规则
								<span class="am-icon-chevron-down am-fr"></span>
                            </div>
                            <div id="collapse-panel-1" class="am-padding am-collapse am-in">
                                <div>
                                    <!--奖励规则内容开始-->

                                    <div class="am-g am-margin-top">
                                        <div class="am-u-md-3 am-text-right am-padding-top-xs"><strong>奖励详情（填入数字）</strong></div>
										<div class="am-input-group am-u-md-5 am-u-end">
											<span class="am-input-group-label">首次关注（自然关注）</span>
											<input type="text" class="am-form-field natural_attention" value="{:C('itk_wxscore_rule.natural_attention')}"  class="am-form-field am-input-sm" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
											<span class="am-input-group-label">积分</span>
										</div>	
                                    </div>
									
									<div class="am-g am-margin-top">
										<div class="am-input-group am-u-md-5 am-u-md-offset-3">
										  <span class="am-input-group-label">首次关注（被邀请）</span>
										  <input type="text" class="am-form-field first_attention am-input-sm" value="{:C('itk_wxscore_rule.first_attention')}" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
										  <span class="am-input-group-label">积分</span>
										</div>
									</div>																		 
									
                                    <div class="am-g am-margin-top">
										<div class="am-input-group am-u-md-5 am-u-md-offset-3">
										  <span class="am-input-group-label">一级奖励</span>
										  <input type="text" class="am-form-field am-input-sm first_reward" value="{:C('itk_wxscore_rule.first_reward')}" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
										  <span class="am-input-group-label">积分</span>
										</div>
                                    </div>

                                    <div class="am-g am-margin-top"  style="display:none">
										<div class="am-input-group am-u-md-5 am-u-md-offset-3">
										  <span class="am-input-group-label">二级奖励</span>
										  <input type="text" class="am-form-field am-input-sm second_reward" value="{:C('itk_wxscore_rule.second_reward')}" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
										  <span class="am-input-group-label">积分</span>
										</div>
                                    </div>

                                    <div class="am-g am-margin-top-xl"  style="display:none">
                                        <div class="am-u-md-3 am-text-right"><strong>奖励上限</strong></div>
										<div class="am-input-group am-u-md-5 am-u-end">
											<input value="{:C('itk_wxscore_rule.reward_limit')}" class="reward_limit am-form-field am-input-sm" type="text" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
										</div>
                                    </div>
									<div class="am-g am-margin-top-xs"  style="display:none">
										<div class="am-u-md-5 am-u-md-offset-3 deduct_tips">
												<small>注意：当粉丝的邀请总积分数大于等于这个上限时，无法获得积分，0表示无上限</small>
										</div>
									</div>
									<!--每日邀请上限-->
									<div class="am-g am-margin-top-xl"  style="display:none">
										 <div class="am-u-md-3 am-text-right"><strong>每日邀请上限</strong></div>
										 <div class="am-input-group am-u-md-5 am-u-end">
											<input value="{:C('itk_wxscore_rule.people_limit')}" class="people_limit am-form-field am-input-sm" type="text" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
										</div>
                                    </div>
									<div class="am-g am-margin-top-xs"  style="display:none">
										<div class="am-u-md-5 am-u-md-offset-3 deduct_tips">
												<small>注意：当粉丝的每日邀请人数大于等于这个上限时，无法获得积分，0表示无上限</small>
										</div>
									</div>
									<!--每日邀请上限结束-->
									
								<!--详细规则开始-->					
								<div class="am-g am-margin-top-xl">
									 <div class="am-u-md-3 am-text-right"><strong>详细规则</strong></div>
										<div class="am-input-group am-u-md-6 am-u-end">
																				<textarea class="am-form-field am-padding-sm am-text-sm inv_rules" style="width:50rem;height:15rem; font-size:1.4rem;" >{:C('itk_wxscore_rule.inv_rules')}</textarea>										</div>
								</div>
								<!--详细规则结束-->

                                    <div class="am-g am-margin-top-xl">
										 <div class="am-u-md-3 am-text-right"><strong>取消关注</strong></div>
										 <div class="am-input-group am-u-md-5 am-u-end">
											<input value="{:C('itk_wxscore_rule.action_cancel_val')}" class="action_cancel_val am-form-field am-input-sm" type="text">
										 </div>
                                    </div>
                                
									<div class="am-g am-margin-top-xs">
										<div class="am-u-md-4 am-u-md-offset-3 deduct_tips">
												<small>注意：0代表不扣分；-1代表他要扣除的分数</small>
										</div>
									</div>
									<!--扣除上上级积分开始-->
									<div class="am-g am-margin-top-sm">
                                        <div class="am-u-md-3 am-text-right"><strong>扣除上上级积分</strong></div>
										<div class="am-input-group am-u-md-5 am-u-end">
											<input value="{:C('itk_wxscore_rule.cancel_highest_val')}" class="cancel_highest_val am-form-field am-input-sm" type="text">
										 </div>
                                    </div>
									<div class="am-g am-margin-top-xs">
										<div class="am-u-md-4 am-u-md-offset-3 deduct_tips">
											<small>注意：0代表不扣分；-1代表他要扣除的分数</small>
										</div>
									</div>
									
									<!--扣除上上级积分结束-->
                                    <div class="am-g am-margin-top" style="display:none">
                                        <!--<div class="am-u-sm-3 title notice_superior">
                                          通知上级提示语
                                        </div>-->
										<div class="am-u-md-3 am-text-right"><strong>通知上级提示语</strong></div>
                                        <div class="am-input-group am-u-md-5 am-u-end">
											                                            <input value="{:C('itk_wxscore_rule.cancel_tips_val')}" class="cancel_tips_val am-form-field am-input-sm" type="text">                                        </div>
                                    </div>
									<div class="am-g am-margin-top-xs" style="display:none">
										<div class="am-u-md-6 am-u-md-offset-2 deduct_tips">
											<small>示例：你的朋友{取消人昵称}取消了关注，扣除您{扣除上级积分}积分；{取消人昵称}与{扣除上级积分}为可调用代码</small>
										</div>
									</div>
                                    <!--奖励规则内容结束-->
                                </div>
                            </div>
                        </div>
                        <!--设置奖励规则结束-->

                        <!--提示语设置开始-->
                        <div class="am-panel am-margin-vertical am-margin-left-0 am-panel-default" style="display:none">
                            <div class="am-panel-hd am-cf" data-am-collapse="{target: '#collapse-panel-3'}">
                                提示语设置
								<span class="am-icon-chevron-down am-fr"></span>
                            </div>
                            <div id="collapse-panel-3" class="am-padding am-collapse am-in">
                                <div>
                                    <div class="am-g">
                                        <div class="am-u-md-4">
											<div class="am-text-left am-margin-bottom">
												<strong>首次关注提示语</strong>
											</div>
											<div class="">
																									<textarea class="attention_tips_val tips_input am-form-field am-input-sm" value="">{:C('itk_wxscore_rule.attention_tips_val')}</textarea >											</div>
											<div class="deduct_tips">
												<small>
													示例：{关注人昵称}，恭喜您获得{关注积分}积分，积分可以免费兑换礼品哦！公众号每日推送天猫商家内部无门槛优惠券，让您领券购物比聚划算还实惠；{关注人昵称}与{关注积分}为可调用代码
												</small>
											</div>
										</div>
										
										<div class="am-u-md-4" style="display:none">
											<div class="am-text-left am-margin-bottom">
												<strong>推广上级提示语</strong>
											</div>
											<div class="">
																									<textarea value="" class=" superiors_tips_val tips_input am-form-field am-input-sm" type="text">{:C('itk_wxscore_rule.superiors_tips_val')}</textarea>											</div>
											<div class="deduct_tips">
											<small>																示例：您的朋友{下级昵称}因您而关注到平台，这是您推荐第{粉丝数}人，感谢您的无私付出，特赠送您{邀请积分}积分；{下级昵称}、{邀请积分}和{粉丝数}为可调用代码
											</small>
											</div>
										</div>
										
										<div class="am-u-md-4" style="display:none">
											<div class="am-text-left am-margin-bottom">
												<strong>推广上上级提示语</strong>
											</div>
											<div class="">
																									<textarea value="" class="heightes_tips_val tips_input am-form-field am-input-sm" type="text">{:C('itk_wxscore_rule.heightes_tips_val')}</textarea>											</div>
											<div class="deduct_tips">
												<small>													示例：您的朋友的朋友{下级昵称}因您而关注到平台，感谢您的无私付出，特赠送您{邀请积分}积分；{下级昵称}与{邀请积分}为可调用代码,不填则不发送
											</small>
											</div>
										</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--提示语设置结束-->

                        <!--海报预览开始-->
                        <div class="am-panel am-margin-vertical am-margin-left-0 am-panel-default" >
                            <div class="am-panel-hd am-cf" data-am-collapse="{target: '#collapse-panel-2'}"  > 
                                海报设计
									<span class="am-icon-chevron-down am-fr"></span>
                            </div>
                            <div id="collapse-panel-2" class="am-padding am-collapse am-in" >

							    
                                <div class="am-g" style="display:none">
								   <div class="am-u-md-2 am-text-right"><strong>生成二维码海报等待提示</strong></div>
                                    <div class="am-input-group am-u-md-8 am-u-end">
										                                        <input value="{:C('itk_wxscore_rule.posters_tips_val')}" class="am-form-field posters_tips_val am-input-sm" type="text">                                    </div>
                                    <br />
                                </div> 


                                <!--预览开始--> 
								<div class="am-g am-margin-top-lg" style="display:none">
									<div class="am-u-md-2 am-text-right"><strong>请选择二维码海报类型</strong></div>
									<div class="am-input-group am-u-md-4 am-u-end">
										<div class="am-margin-bottom upload_poster" style="display:inline-block;">
											<button class="am-btn am-btn-primary">
												自定义海报
												<i class="am-icon-cloud-upload"></i>												
											</button>
										</div>
										<div class="am-margin-bottom am-margin-left-sm" style="display:inline-block;">
											<button class="am-btn am-btn-warning download_template">
												下载模板
												<i class="am-icon-cloud-download"></i>										  
											</button>
										</div>
									</div>
								</div>
								<div class="am-g am-margin-top-sm">
                                <div class="preview_start am-u-md-8 am-u-md-offset-2 am-margin-top" style="display: inline-block; position: relative; top: -34px">																											
                                    <ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-3 am-avg-lg-5 am-gallery-overlay poster_ul" data-am-gallery="{ pureview: true }" style="width: 70%;padding-left:0">
																			
                                        <li class="am-padding-sm" style="padding-left:0;">
                                            <div class="am-gallery-item" style="display: inline">
                                                <a href="__STATIC__/weixin/assets/sell/images/default_poster_preview/poster_preview_1.png" class="">
                                                    <img src="__STATIC__/weixin/assets/sell/images/default_poster_preview/poster_preview_1.png" alt="海报预览" />
                                                </a>
                                            </div>
                                            <div class="am-radio-inline am-round am-margin-top-sm">
                                                <label>
                                                    <input type="radio" name="doc-radio-1" value="1" style="height: 15px; width: 15px;" class="type_def first_poster" <if condition="C('itk_wxscore_rule.poster_type',null,1) eq 1">checked</if> >
                                                    <span class="am-margin-left-xs">类型一</span>
                                                </label>
                                            </div>

                                        </li>
                                        <li class="am-padding-sm">
                                            <div class="am-gallery-item" style="display: inline">
                                                <a href="__STATIC__/weixin/assets/sell/images/default_poster_preview/poster_preview_2.png" class="">
                                                    <img src="__STATIC__/weixin/assets/sell/images/default_poster_preview/poster_preview_2.png" alt="海报预览" />
                                                </a>
                                            </div>
                                            <div class="am-radio-inline am-round am-margin-top-sm">
                                                <label>
                                                    <input type="radio" name="doc-radio-1" value="2" style="height: 15px; width: 15px;" <if condition="C('itk_wxscore_rule.poster_type',null,1) eq 2">checked</if>>
                                                    <span class="am-margin-left-xs">类型二</span>
                                                </label>
                                            </div>

                                        </li>
                                        <li class="am-padding-sm">
                                            <div class="am-gallery-item" style="display: inline">
                                                <a href="__STATIC__/weixin/assets/sell/images/default_poster_preview/poster_preview_3.png" class="">
                                                    <img src="__STATIC__/weixin/assets/sell/images/default_poster_preview/poster_preview_3.png" alt="海报预览" />

                                                </a>
                                            </div>
                                            <div class="am-radio-inline am-round am-margin-top-sm">
                                                <label>
                                                    <input type="radio" name="doc-radio-1" value="3" style="height: 15px; width: 15px;" <if condition="C('itk_wxscore_rule.poster_type',null,1) eq 3">checked</if>>
                                                    <span class="am-margin-left-xs">类型三</span>
                                                </label>
                                            </div>

                                        </li>
                                        <li class="am-padding-sm">
                                            <div class="am-gallery-item" style="display: inline">
                                                <a href="__STATIC__/weixin/assets/sell/images/default_poster_preview/poster_preview_4.png" class="">
                                                    <img src="__STATIC__/weixin/assets/sell/images/default_poster_preview/poster_preview_4.png" alt="海报预览" />

                                                </a>
                                            </div>
                                            <div class="am-radio-inline am-round am-margin-top-sm">
                                                <label>
                                                    <input type="radio" name="doc-radio-1" value="4" style="height: 15px; width: 15px;" <if condition="C('itk_wxscore_rule.poster_type',null,1) eq 4">checked</if>>
                                                    <span class="am-margin-left-xs">类型四</span>
                                                </label>
                                            </div>

                                        </li>
                                        <li class="am-padding-sm">
                                            <div class="am-gallery-item" style="display: inline">
                                                <a href="__STATIC__/weixin/assets/sell/images/default_poster_preview/poster_preview_5.png" class="">
                                                    <img src="__STATIC__/weixin/assets/sell/images/default_poster_preview/poster_preview_5.png" alt="海报预览" />

                                                </a>
                                            </div>
                                            <div class="am-radio-inline am-round am-margin-top-sm">
                                                <label>
                                                    <input type="radio" name="doc-radio-1" value="5" style="height: 15px; width: 15px;" <if condition="C('itk_wxscore_rule.poster_type',null,1) eq 5">checked</if> >
                                                    <span class="am-margin-left-xs">类型五</span>
                                                </label>

                                            </div>

                                        </li>
										
																				
										<!--自定义海报-->
																				<!--自定义海报结束-->
										<li class="am-padding-sm loading" style="display:none;">
											<div class="poster_local" style="margin-top:10rem;margin-left:3rem;">
												<i class="am-icon-refresh am-icon-spin am-icon-md "></i> 上传中,请稍候
											</div>
										</li>
                                    </ul>
					
                                </div>
								</div>
                                <!--预览结束-->
								
                            </div>
							<!--上传表单-->
							<div>
								<form method="post" enctype="multipart/form-data" action="/wxinvite/upload_image.html" id="imageUpload">
									<input type="file" name="upload_image" id="upload_input"   accept="image/*">
								</form>
							</div>
							<!--上传表单结束-->
							
                        </div>
                        <!--海报预览结束-->
                        <!--防作弊功能开始-->
                        <div class="am-panel am-margin-vertical am-margin-left-0 am-panel-default" style="display:none">
                            <div class="am-panel-hd am-cf" data-am-collapse="{target: '#collapse-panel-4'}">
                                防作弊设置
								<span class="am-icon-chevron-down am-fr"></span>
                            </div>
                            <div id="collapse-panel-4" class="am-padding am-collapse am-in">
                                <div>
                                    <div class="open_cheating">
                                        <form class="am-form am-padding-bottom-xs">
                                            <div>
                                                <label class="am-radio-inline">
                                                    <input type="radio" class="open_cheat_function" value="1" name="docInlineRadio">
                                                    开启防作弊功能
                                                </label>
                                                <label class="am-radio-inline">
                                                    <input type="radio" value="0" class="close_cheat_function" name="docInlineRadio" checked="checked">
                                                    关闭防作弊功能
                                                </label>
                                            </div>

                                        </form>
                                    </div>
                                    <div class="instructions am-padding-vertical-xs">
                                       <small> 警告：当用户数量比较大的时候，开启反作弊监视会消耗更多的系统资源，您的公众号对用户回复速度将变慢，如无必要建议关闭反作弊监视</small>
                                    </div>
									<div class="am-g am-margin-top-lg">
										<div class="am-u-md-1 am-text-left"><strong>规则设置</strong></div>
										 <div class="am-input-group am-u-md-5 am-u-end">
											 <span class="am-input-group-label">在</span>
											 <input type="text" class="am-form-field am-input-sm seconds_val cheat_input" value="" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
										  <span class="am-input-group-label">秒内</span>
										 </div>
									</div>   
									
									<div class="am-g am-margin-top">
										<div class="am-input-group am-u-md-5 am-u-md-offset-1">
											 <span class="am-input-group-label">用户新增</span>
											 <input type="text" class="am-form-field am-input-sm user_num cheat_input" value="" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
										  <span class="am-input-group-label">个下线则自动划入黑名单</span>
										</div>
									</div>									                               
									<div class="am-g am-margin-top">
										<div class="am-input-group am-u-md-5 am-u-md-offset-1">
											 <span class="am-input-group-label">并给OPENID</span>
											 <input type="text" class="am-form-field am-input-sm openid_val cheat_input" value="">
										  <span class="am-input-group-label">的管理员发送提示消息</span>
										</div>
									</div>
                                    <div class="instructions am-padding-vertical-xs am-margin-top">
                                      <small>  反作弊机制：目前的策略是用户在一段时间内，如果新增的下线粉丝，超过了设定的值，则会认定为恶意刷粉，将其拉入黑名单，【OPENID】可以在【会员管理】->【微信会员】中的昵称下找到</small>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="submit_button ">

                            <button style="margin-left: 0; display:none" type="rest" class="give_up_save am-btn am-btn-primary am-fl">恢复默认</button>
                            <button type="button" class="submit_save   am-margin-horizontal am-btn am-btn-primary">提交保存</button>
                        </div>
                    </div>
                </div>	
            </div>
			
			<!--修改海报名称模态框-->
			<div class="am-modal am-modal-prompt" tabindex="-1" id="edit_poster">
			  <div class="am-modal-dialog">
				<div class="am-modal-hd edit_data_title">修改海报名称</div>
				<div class="am-modal-bd">
				  <input type="text" value="" class="am-modal-prompt-input new_poster_name" data-id="">
				</div>
				<div class="am-modal-footer">
				  <span class="am-modal-btn confirm_save_name" data-am-modal-confirm data-id="">提交</span>
				  <span class="am-modal-btn" data-am-modal-cancel  data-id="">取消</span>
				</div>
			  </div>
			</div>
			<!--修改海报名称模态框结束-->
			
			<!--修改失败模态框-->
				<div class="am-modal am-modal-confirm" tabindex="-1" id="edit_lose_alert">
				  <div class="am-modal-dialog">
					<div class="am-modal-hd "></div>
					<div class="am-modal-bd edit_lose">
					 
					</div>
					<div class="am-modal-footer">
					 
					  <span class="am-modal-btn" data-am-modal-confirm>确定</span>
					</div>
				  </div>
				</div>	
			<!--修改失败模态框结束-->
        </div>
        <style type="text/css">	
.appmsg_content {
	position:relative;
	width:320px;
	border: 1px solid #e7e7eb;
}
.appmsg_info {
	font-size:13px;
	line-height:20px;
	padding:12px 14px 0;
}
.appmsg_item {
	position:relative;
	padding:12px 14px;
}
.appmsg_date {
	font-weight:400;
	font-style:normal;
}
.appmsg_title {
	margin:0;
	font-weight:400;
	font-style:normal;
	font-size:14px;
	line-height:28px;
	max-height:56px;
	overflow:hidden;
	word-wrap:break-word;
	word-break:break-all;
	color:#222;
	text-align:left;
}
.appmsg_thumb_wrp {
	height:160px;
	overflow:hidden;
	background-repeat: no-repeat;
	background-position:center center;
	background-size:cover;
}
.appmsg_desc {
	padding:5px 0 10px;
	margin:0;
	word-wrap:break-word;
	word-break:break-all;
}
.appmsg_content .cover_appmsg_item {
	position:relative;
	margin:22px 14px;
}
.cover_appmsg_item .appmsg_title {
	font-size:14px;
	position:absolute;
	bottom:0;
	left:0;
	right:0;
	background:rgba(0,0,0,0.6)!important;
}
.cover_appmsg_item .appmsg_title a {
	color:#fff;
}
.has_cover {
	height:102px;
	border-top:1px solid #e7e7eb;
}
.has_cover .appmsg_thumb_wrp {
	float:right;
	width:78px;
	height:78px;
	margin-left:14px;
	margin:0;
}
.has_cover .appmsg_title {
	display:inline-block;
	width:200px;
	line-height:24px;
	max-height:48px;
	overflow: hidden;
	margin-top:14px;
}
.appmsg_title a {
	display:block;
	padding:0 8px;
	color:#222;
}
.newsbox {
	width:30%;
	height:100%;
	float:left;
	margin:0 15px;
}
.newsbox .appmsg_content {
	width:100%	}
.newsbox .appmsg_title a {
	text-align:left;
}
.newsbox .has_cover .appmsg_title {
	width:180px;
}
.newsbox .appmsg_info {
	text-align: left;
}
.newsbox .appmsg_desc {
	text-align: left;
}
.newsDesc {
	position:relative;
	margin-bottom:20px;
}
.chooseNew {
	position:absolute;
	top:0;
	left:0;
	right:0;
	bottom:0;
	background-color:rgba(0,0,0,0.6);
	z-index:999;
	display:none;
}
.news_table {
	padding:15px 10px;
	height:80%;
	overflow:hidden;
	margin:0;
}
.news_content_box .mT {
	margin-top:25%;
}
.loading {
	display:block;
}
.news_content_box {
	border:1px solid #e7e7eb;
	padding:15px 0;
}
.choose_icon {
	background: transparent url(/Public/assets/sell/images/selected_mask_icon.png) no-repeat 0 0;
	width: 45px;
	height: 38px;
	position:absolute;
	top:45%;
	left:43%;
}
<!--删除修改样式开始-->	.grid_item.no_extra {
	float: none;
	width: auto;
	overflow: hidden;
}
.appmsg_opr_item {
	line-height: 44px;
	height: 44px;
	width:148px;
}
.newsbox ul {
	border-bottom: 1px solid #e7e7eb;
	border-right: 1px solid #e7e7eb;
	border-left: 1px solid #e7e7eb;
	padding-left: 0px;
	background:#e7e7eb;
	margin-bottom:20px;
	position: relative;
}
.newsbox li {
	float:left;
}
.right_del:hover {
	color:#000;
}
.li_left {
	border-right:0.5px solid #ccc;
	cursor:pointer;
}
.li_right {
	cursor:pointer;
}
<!--警告框样式开始-->	.popover {
	width: 290px;
}
.del_confirm .popover {
	display:none;
	position: absolute;
	margin-top: 12px;
	z-index:2001;
}
.del_confirm .popover .popover_inner {
	border: 1px solid #d9dadc;
	word-wrap: break-word;
	word-break: break-all;
	padding: 30px;
	background-color: #fff;
	-webkit-box-shadow: none;
	width:216px;
	height:136px;
}
.tl {
	text-align: left;
}
.del_confirm .popover_content p {
	display: block;
	-webkit-margin-before: 1em;
	-webkit-margin-after: 1em;
	-webkit-margin-start: 0px;
	-webkit-margin-end: 0px;
	margin: 0;
}
.popover .popover_bar {
	text-align: justify;
	text-justify: distribute-all-lines;
	font-size: 0;
	width:100%;
}
.popover .popover_bar .btn {
	/*margin-top: 18px;*/
	
}
.btn {
	min-width: 60px;
	display: inline-block;
	overflow: visible;
	padding: 0 22px;
	height: 30px;
	line-height: 30px;
	vertical-align: middle;
	text-align: center;
	text-decoration: none;
	border-radius: 3px;
	-moz-border-radius: 3px;
	-webkit-border-radius: 3px;
	font-size: 14px;
	border-width: 1px;
	border-style: solid;
	cursor: pointer;
	margin-left:12px;
}
.btn_primary {
	background-color: #44b549;
	background-image: -moz-linear-gradient(top,#44b549 0,#44b549 100%);
	background-image: -webkit-gradient(linear,0 0,0 100%,from(#44b549),to(#44b549));
	background-image: -webkit-linear-gradient(top,#44b549 0,#44b549 100%);
	background-image: -o-linear-gradient(top,#44b549 0,#44b549 100%);
	background-image: linear-gradient(to bottom,#44b549 0,#44b549 100%);
	border-color: #44b549;
	color: #fff;
	margin-top:18px;
	margin-left:0px;
}
.popover_bar a {
	outline: 0;
}
.btn_primary:hover {
	color:fff;
}
.btn_default:hover {
	background-color: #e7e7eb;
	background-image: -moz-linear-gradient(top,#e7e7eb 0,#e7e7eb 100%);
	background-image: -webkit-gradient(linear,0 0,0 100%,from(#e7e7eb),to(#e7e7eb));
	background-image: -webkit-linear-gradient(top,#e7e7eb 0,#e7e7eb 100%);
	background-image: -o-linear-gradient(top,#e7e7eb 0,#e7e7eb 100%);
	background-image: linear-gradient(to bottom,#e7e7eb 0,#e7e7eb 100%);
	border-color: #dadbe0;
	box-shadow: none;
	-moz-box-shadow: none;
	-webkit-box-shadow: none;
	color: #000;
	!important
}
.btn_default {
	margin-top:18px;
	margin-right:-10px;
	border:#e7e7eb solid 1px;
	color:#000;
}
.btn:hover {
	text-decoration: none;
}
.t1 {
	font-size:14px;
}
.del_confirm .popover .popover_arrow_out {
	top: 0;
}
.del_confirm .popover .popover_arrow {
	position: absolute;
	left: 50%;
	margin-left: -8px;
	margin-top: -8px;
	display: inline-block;
	width: 0;
	height: 0;
	border-width: 8px;
	border-style: dashed;
	border-color: transparent;
	border-top-width: 0;
	border-bottom-color: #d9dadc;
	border-bottom-style: solid;
}
.del_confirm .popover .popover_arrow_in {
	border-bottom-color: #fff;
	top: 1px;
}
.edit_confirm .speech-bubble {
	display:none;
	position: absolute;
	background-color: #666;
	margin-left: auto;
	margin-right: auto;
	width: 35px;
	height: 27px;
	line-height: 27px;
	/* 垂直居中*/
	color: white;
	text-align: center;
	/*border-radius: 10px;
	font-family: sans-serif;*/
	bottom:55px;
	left:55px;
}
.edit_confirm p {
	font-size:12px;
}
.edit_confirm .speech-bubble:after {
	content: '';
	position: absolute;
	width: 0;
	height: 0;
	border: 5px solid;
}
.edit_confirm .speech-bubble-bottom:after {
	border-top-color: #666;
	top: 100%;
	left: 74%;
	margin-left: -15px;
}
.del_confirm .speech-bubble {
	display:none;
	position: absolute;
	background-color: #666;
	margin-left: auto;
	margin-right: auto;
	width: 35px;
	height: 27px;
	line-height: 27px;
	/* 垂直居中*/
	color: white;
	text-align: center;
	/*border-radius: 10px;
	font-family: sans-serif;*/
	bottom:55px;
	right:51px;
}
.del_confirm p {
	font-size:12px;
}
.del_confirm .speech-bubble:after {
	content: '';
	position: absolute;
	width: 0;
	height: 0;
	border: 5px solid;
}
.del_confirm .speech-bubble-bottom:after {
	border-top-color: #666;
	top: 100%;
	left: 74%;
	margin-left: -15px;
}
<!--警告框样式结束-->	<!--介绍-->
</style>

<!--回复图文项 start-->
	<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-news" data-id="3">
		<div class="am-modal-dialog">
		   	<div class="am-modal-hd modal-hd-top">
		   		选择图文素材
		        <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="">×</a>
		    </div>
		    <div class="am-cf">
				<button type="button" style="background:#5eb95e;border-color:#5eb95e;border-radius:3px;" class="am-margin-sm am-fl am-btn am-btn-secondary type_news getMaterial">重新获取图文</button>
				<button type="submit" class="am-fl am-btn am-margin-sm am-btn-secondary" id="material_up" style="display:none;margin-left:0px;background:#5eb95e;border-color:#5eb95e; border-radius:3px;" disabled data-start="">上一页</button>
				<button type="submit" class="am-fl am-margin-sm am-btn am-btn-secondary" style="margin-left:0px;background:#5eb95e;border-color:#5eb95e;border-radius:3px;display:none;"  id="material_down" data-start="">下一页
				</button>
				<button type="button" class="am-btn am-btn-secondary" style="float:right;margin-right:21px;margin-top:10px;"><a href="/wxmaterial/createnews.html" target="_blank" style="color:#fff;">+ 新建图文消息</a></button>
		    </div>
		    <div class="news_table">
		    	<div class="news_content_box" style="width:100%;height:100%;overflow:overlay;">
		    		<div class="loading mT">
		    			<i class="am-icon-refresh am-icon-spin am-icon-md"></i> 获取中,请稍候
		    		</div>
		    	</div>
		    </div>
		    <button type="submit" class="am-btn am-btn-secondary am-disabled" data-am-modal-close="" data-id="" id="edit_news" data-src="" data-title="" data-edit="0">确认选择</button>
		    <button type="reset" class="am-btn am-btn-secondary" style="width:98px;" data-am-modal-close="" class="modal-close">取&nbsp;&nbsp;消</button>
		</div>
	</div>
	<!--回复图文项 end-->
	
	
	<!--回复图片项 star-->
	<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-image" data-id="2">
    
		<div class="am-modal-dialog">
		   	<div class="am-modal-hd modal-hd-top">选择图片
		        <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="">×</a>
		    </div>
		    <div class="image_table">
		    	<form method="post" enctype="multipart/form-data" name="form_image" id="image_upload" action="/wxautoreply/local_image.html " style="display:none;" >
						<input type="file" name="upload_image" value="" class="addimage" style="opacity:0" id="upload_image"  accept="image/*" multiple="multiple"/>
					</form>
		    	<div class="file_local"> 
					<button type="button" id="image_agin" class="image_model am-fl am-btn am-btn-secondary" style="margin-left:10px;border-radius:3px;background:#5eb95e;border-color:#5eb95e;" >重新获取图片</button>
					<button id="last_image" type="button" class=" am-fl am-btn am-btn-secondary" disabled style="margin-left:10px;background:#5eb95e;border-color:#5eb95e;display:none;border-radius:3px;" data-start="" />上一页
					</button>
					<button id="next_image" type="button" class="am-fl am-btn am-btn-secondary" style="display:none;margin-left:10px;background:#5eb95e;border-color:#5eb95e;border-radius:3px;" data-start="" />下一页
					</button>
		    		<button type="button" class="am-btn am-btn-secondary file_image" style="float:right;margin-right:10px;" >本地上传</button>
		    	</div>
		    	<div class="image_list" style="margin-top:32px;"><i class="am-icon-refresh am-icon-spin am-icon-sm" style="margin-top:255px"></i></div>
				<div class="ima_showbutton">
					
				</div>
		    </div>
		    <button type="submit" class="am-btn am-btn-secondary am-disabled" data-am-modal-close="" id="edit_image" data-id="" data-edit="0">确认选择</button>
		    <button type="reset" class="am-btn am-btn-secondary" style="width:98px;" data-am-modal-close="" class="modal-close">取&nbsp;&nbsp;消</button>
		</div>
        
	</div>
	<!--回复图片项 end-->
	
	<script>
		$(function(){
			//选择图文
			$('.news_content_box').on('mouseover','.newsDesc',function(){
				$('.chooseNew').hide();
				$('.choose').siblings('.chooseNew').show();
				$(this).children('.appmsg_content').css('border','1px solid #5eb95e');
				$('.choose').css('border','1px solid #e7e7eb');
			});
			$('.news_content_box').on('mouseout','.newsDesc',function(){
				$('.chooseNew').hide();
				$('.choose').siblings('.chooseNew').show();
				$('.newsDesc .appmsg_content').css('border','1px solid #e7e7eb');
			})

			$('.news_content_box').on('click','.newsDesc',function(){
				$('.newsbox .appmsg_content').removeClass('chooseicon');
				$('.newsbox .appmsg_content').removeClass('choose');
				$('.chooseNew').hide();
				$(this).children('.chooseNew').show();
				$(this).children('.chooseNew').html('<div class="choose_icon"></div>');
				$(this).children('.appmsg_content').addClass('choose');
				$('#edit_news').removeClass('am-disabled');
			});

			$('.getMaterial').click(function(){
				$('.newsbox').remove();
				$('.news_content_box').html('<div class="loading mT"><i class="am-icon-refresh am-icon-spin am-icon-md"></i> 获取中,请稍候</div>');
			});
			//图文列表
			$('.type_news').click(function(){
				
				var news_content_length= $('.news_content_box').html().length;
				$('.type_news').ajaxSubmit({
					data:{"type":3},
					type:'post',
					url:'/wxmaterial/getnews.html',
					beforeSubmit:function(){
						if(news_content_length>129){
							return false;
						};
					},
					success:function(data){
						var $newsList = data.list;
						var content = '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 0){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 1){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item"><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 2){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item '+$newsList[i]['media_id']+'" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						$('.news_content_box').html(content);
						$('#material_up').attr('data-start',0);
						$('#material_down').attr('data-start',10);
						$('#material_up').attr('disabled',true);
						$('#material_down').attr('disabled',false);
						if($newsList.length<data.count){
							$('#material_up').css('display','block');
							$('#material_down').css('display','block');
						}else{
							$('#material_up').css('display','none');
							$('#material_down').css('display','none');
						}
						
					}
				});
			});
			
			//重新获取图片
			$('#image_agin').click(function(){
			
				$('.show_image').remove();
				$('.image_list').html('<i class="am-icon-refresh am-icon-spin am-icon-sm" style="margin-top:255px"></i>');
			
			})
			
			//图片模态框显示
			$('.image_model').click(function(){
			$('.image_model').ajaxSubmit({
				url:"/wxautoreply/image_how.html",
				type:'get',
				//data:{'start':$('#next_image').attr('data-start')},
				beforeSubmit:function(){
					if($('.image_list').html().length>80){
								return false;
							}
				},
				success:function(data){
					var $image_array = data.array; 
					var image_show = "";
					for(var i =0;i< $image_array.length;i++){
						image_show +='<div class="show_image"><div class="selected_mask"><div class="selected_mask_inner"></div><div class="selected_mask_icon"></div></div><img src="'+$image_array[i]['url']+'" alt="" data-id ="'+$image_array[i]['media_id']+'" class="selected_image"></div>';
					}
					$('.image_list').html(image_show);
					if($image_array.length<data.count){
						$('#next_image').css('display','block');
						$('#last_image').css('display','block');
					}else{
						$('#next_image').css('display','none');
						$('#last_image').css('display','none');
					}
				},
				error:function(){
					console.log("失败");
				}
			});
			$('#next_image').attr('data-start',20);
			$('#last_image').attr('data-start',0);
	})
	
	
		});
//下一页图片
$("#next_image").click(function(){
		$('.show_image').remove();
		$('.image_list').html('<i class="am-icon-refresh am-icon-spin am-icon-sm" style="margin-top:255px"></i>');
		$.ajax({
				url:"/wxautoreply/image_how.html",
				type:'get',
				data:{'start':$('#next_image').attr('data-start')},
				success:function(data){
					var $image_array = data.array; 
					var image_show = "";
					for(var i =0;i< $image_array.length;i++){
						image_show +='<div class="show_image"><div class="selected_mask"><div class="selected_mask_inner"></div><div class="selected_mask_icon"></div></div><img src="'+$image_array[i]['url']+'" alt="" data-id ="'+$image_array[i]['media_id']+'" class="selected_image"></div>';
					}
					$('.image_list').html(image_show);
					if($image_array!=''){
						var next_image = parseInt($('#next_image').attr('data-start'));
						var next_image_start = next_image+20;
						$('#next_image').attr('data-start',next_image_start);
						var last_image = parseInt($('#last_image').attr('data-start'));
						var last_image_start =	next_image-20;
						$('#last_image').attr('data-start',last_image_start);
						$('#last_image').attr('disabled',false);
					}else{
						$('.image_list').html('<div style="margin-top:255px;">没有了</div>');
						$('#next_image').attr('disabled',true);
						var rest_last_image = parseInt($('#last_image').attr('data-start'))+20;
						$('#last_image').attr('data-start',rest_last_image);
					}
				},
			});
})
//上一页图片
$("#last_image").click(function(){
	$('.show_image').remove();
		$('.image_list').html('<i class="am-icon-refresh am-icon-spin am-icon-sm" style="margin-top:255px"></i>');
		$.ajax({
				url:"/wxautoreply/image_how.html",
				type:'get',
				data:{'start':$('#last_image').attr('data-start')},
				success:function(data){
					var $image_array = data.array; 
					var image_show = "";
					for(var i =0;i< $image_array.length;i++){
						image_show +='<div class="show_image"><div class="selected_mask"><div class="selected_mask_inner"></div><div class="selected_mask_icon"></div></div><img src="'+$image_array[i]['url']+'" alt="" data-id ="'+$image_array[i]['media_id']+'" class="selected_image"></div>';
					}
					$('.image_list').html(image_show);
					if($("#next_image").attr('disabled')){
						var a = parseInt($("#next_image").attr('data-start'))+20;
						$("#next_image").attr('data-start',a);
						//var b =	parseInt($("#last_image").attr('data-start'))+20;
						//$("#last_image").attr('data-start',b);
					}
					var last_image = parseInt($('#last_image').attr('data-start'));
					var last_image_start = last_image-20;
					$('#last_image').attr('data-start',last_image_start);
					var next_image = parseInt($('#next_image').attr('data-start'));
					var next_image_start = next_image-20;
					$('#next_image').attr('data-start',next_image_start);
					$('#next_image').attr('disabled',false);
					if($('#last_image').attr('data-start')<0){
						$('#last_image').attr('disabled',true);
					}
				},
			});
})


//上传图片
$('.file_image').click(function(){
	$('.addimage').click();
});
$('#upload_image').change(
	function(){
	$('.image_table .show_image').eq(0).before('<div class="show_image"><span class="text_center"><i class="am-icon-refresh am-icon-spin"></i> 上传中</span></div>');
			if($('.image_table .show_image').length>=20){
				$('.image_table .show_image:last-child').remove();
			}
			$('#edit_image').attr('disabled',true);
			$('.file_image').attr('disabled',true);
			$('.file_image').html('<i class="am-icon-spinner am-icon-spin"></i> 上传中');
			$('#image_upload').ajaxSubmit({
				dataType:'json',
				success:function(data){
					if(data.info == 1){
						$('#edit_image').attr('disabled',false);
						$('.file_image').attr('disabled',false);
						$('.file_image').html('本地上传');
						
					$('.image_table .show_image').eq(0).html('<div class="selected_mask"><div class="selected_mask_inner"></div><div class="selected_mask_icon"></div></div><img src='+data.image_url+' alt="" class="selected_image">');
					}
				}
			});
		}
	
	);

//下一页图文
$('#material_down').click(function(){
	$('.newsbox').remove();
	$('.news_content_box').html('<div class="loading mT" style="display:block;"><i class="am-icon-refresh am-icon-spin am-icon-md"></i> 获取中,请稍候</div>');
	var start = $(this).attr('data-start');
	var end   = $(this).attr('data-num');
	$.ajax({
	
		data:{"type":3,"start":start,"end":end},
		type:'post',
		url:'/wxmaterial/getnews.html',
		success:function(data){
			if(data.info == 1){
				var $newsList = data.list;
						var content = '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 0){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 1){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item"><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 2){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item '+$newsList[i]['media_id']+'" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						$('.news_content_box').html(content);
						if(data.list!=''){
											var material_down_start = parseInt($('#material_down').attr('data-start'));
											var material_up_reststart = material_down_start-10;
											$('#material_up').attr('data-start',material_up_reststart);
											var material_down_reststart = material_down_start+10;
											$('#material_down').attr('data-start',material_down_reststart);
											$('#material_up').attr("disabled",false);
										}else{
												$('.news_content_box').html('<div class="loading mT" style="display:block;">没有了...</div>');
												var rest_upstart= parseInt($('#material_up').attr('data-start'))+10;
												$('#material_up').attr('data-start',rest_upstart);
												$('#material_down').attr("disabled",true);
												$('#material_up').attr("disabled",false);
										}
			}
		}
	})
});

//上一页图文
$('#material_up').click(function(){
	$('.newsbox').remove();
	$('.news_content_box').html('<div class="loading mT" style="display:block;"><i class="am-icon-refresh am-icon-spin am-icon-md"></i> 获取中,请稍候</div>');
	var start = $(this).attr('data-start');
	var end   = $(this).attr('data-num');
	$.ajax({
		data:{"type":3,"start":start,"end":end},
		type:'post',
		url:'/wxmaterial/getnews.html',
		success:function(data){
			if(data.info == 1){
				var $newsList = data.list;
						var content = '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 0){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 1){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item"><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 2){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item '+$newsList[i]['media_id']+'" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						$('.news_content_box').html(content);
						if($('#material_down').attr('disabled')){
							var down_start =  parseInt($('#material_down').attr('data-start'))+10;
							$('#material_down').attr('data-start',down_start);
						}
						$('#material_down').attr('disabled',false);
						var par_start =  parseInt($('#material_up').attr('data-start'))-10;
						$('#material_up').attr('data-start',par_start);
						var down_start = parseInt($('#material_down').attr('data-start'))-10;
						$('#material_down').attr('data-start',down_start);
						if($('#material_up').attr('data-start')<0){
							$('#material_up').attr('disabled',true);
						}
			}
		}
	})
});


//选择图片素材
$('.image_table').on('click','.selected_image',function(){	
	var image_id = $(this).attr('data-id');
	$('#edit_image').attr('data-id',image_id);
	$('.selected_mask').css({'display':'none'});
	$(this).siblings('.selected_mask').css({'display':'block'});
	$(".selected_image").removeClass("choose_image");
	$(this).addClass("choose_image");
	if(image_id!=''){
		$('#edit_image').removeClass('am-disabled');
	}else{
		$('#edit_image').addClass('am-disabled');
	}

});


$('#edit_image').click(function(){
	$('#edit_image').addClass('am-disabled');
	$('.selected_mask').hide();
});
		
</script>
        <footer class="admin-content-footer">
	<hr>
	<p class="am-padding-left">itaoke</p>
</footer>
    </div>

</div>
<div class="am-hide"> </div>					
</html>
<script src="__STATIC__/weixin/assets/sell/js/jquery.form.js"></script>
<script src="__STATIC__/weixin/assets/sell/js/wxinvite.js"></script>
<script>
	
	
    //之前是否有设定防作弊
    if(0==1){
        $('.open_cheat_function').attr('checked',true);
		$('.cheat_input').attr('disabled',false);
    }else{
		$('.cheat_input').attr('disabled',true);
	}
	
	//开启邀请
	$('#auto_inter').click(function(){
		 $('#replay_spinner').show();
		 if ($('#auto_inter').prop('checked') == true) {
            $.ajax({
                url: "index.php?m=Admin&c=Weixin&a=wxisinviteropen",
                type: 'get',
                data: { 'is_invite': 1 },
                success: function (data) {
                    if (data.info == 1) {
                        $('#auto_inter').val(0);
                        $("#fq_confirm_info").text("成功启用邀请功能！");
                        $('#fq_confirm').modal();
					
                    }
                    $('#replay_spinner').hide();
                }
            });
        }else {
            
            $.ajax({
                url: "index.php?m=Admin&c=Weixin&a=wxisinviteropen",
                type: 'get',
                data: { 'is_invite': 0 },
                success: function (data) {
                    $("#fq_confirm_info").html("邀请功能已关闭！");
                    $('#fq_confirm').modal();
                    $('#replay_spinner').hide();
					
                }
            });
        }
	})
	
	
    
	//判断是否开启作弊输入框
	$('.open_cheat_function').click(function(){
		$('.cheat_input').attr('disabled',false);
		$('.cheat_input').css({'cursor':'text'});
	})
	
	$('.close_cheat_function').click(function(){
		$('.cheat_input').attr('disabled',true);
		$('.cheat_input').css({'cursor':'not-allowed'});
	})
	if($('.cheat_input').attr('disabled')=='disabled'){
		$('.cheat_input').css({'cursor':'not-allowed'});
	}
    //提交数据
    $('.submit_save').click(function(){
        var poster_type = $('input:radio[name="doc-radio-1"]:checked').val();
		
		if(poster_type == 7){
			var custom_poster_id = $('input:radio[name="doc-radio-1"]:checked').attr('data-id');
		}
		
        //判断是否开启防作弊功能
        if($('input:radio[name="docInlineRadio"]:checked').val()==1){
            var seconds  = $(".seconds_val").val();
            var user_num = $(".user_num").val();
            var openid   = $(".openid_val").val();
            var cheat = $('input:radio[name="docInlineRadio"]:checked').val();
			
        }
	
        $('.submit_save').ajaxSubmit({
	
            type:'post',
            url:"index.php?m=Admin&c=Weixin&a=wxinvite",
            data:{
                "wxscore_rule[first_attention]":$('.first_attention').val(),
				"wxscore_rule[natural_attention]":$('.natural_attention').val(),
                "wxscore_rule[first_reward]":$('.first_reward').val(),
                "wxscore_rule[second_reward]":$('.second_reward').val(),
                "wxscore_rule[reward_limit]":$('.reward_limit').val(),
                "wxscore_rule[action_cancel_val]":$('.action_cancel_val').val(),
                "wxscore_rule[attention_tips_val]":$('.attention_tips_val').val(),
                "wxscore_rule[superiors_tips_val]":$('.superiors_tips_val').val(),
                "wxscore_rule[heightes_tips_val]":$('.heightes_tips_val').val(),
                "wxscore_rule[seconds]":seconds,
                "wxscore_rule[user_num]":user_num,
                "wxscore_rule[openid]":openid,
                "wxscore_rule[cancel_tips_val]":$(".cancel_tips_val").val(),
                'wxscore_rule[posters_tips_val]':$('.posters_tips_val').val(),
                'wxscore_rule[cheat]':cheat,
                'wxscore_rule[poster_type]':poster_type,
				'wxscore_rule[cancel_highest_val]':$('.cancel_highest_val').val(),
				'wxscore_rule[inv_rules]':$('.inv_rules').val(),
				'wxscore_rule[people_limit]':$('.people_limit').val(),
				'wxscore_rule[custom_poster_id]':custom_poster_id
            },
            beforeSubmit:function(){
				
				//判断是否开启签到功能
				 if ($('#auto_inter').prop('checked') == false) {
						$("#fq_confirm_info").text("数据提交失败，请开启邀请功能");
						$('#fq_confirm').modal();
						return false;
				 }
                var format_1 = /\D/g;
				var pos_int = /^\d+$/; //正整数
				
				if($('.natural_attention').val()==''){
					$("#fq_confirm_info").text("首次关注（自然邀请）积分设置不能为空，请重新设置");
                    $('#fq_confirm').modal();
                    return false;
				}
				
                if($('.first_attention').val()==''){
                    $("#fq_confirm_info").text("首次关注（邀请关注）积分设置不能为空，请重新设置");
                    $('#fq_confirm').modal();
                    return false;
                }
			
                if($('.first_reward').val()==''){
                    $("#fq_confirm_info").text("一级奖励积分设置不能为空，请重新设置");
                    $('#fq_confirm').modal();
                    return false;
                }
			
			/*
                if($('.second_reward').val()==''){
                    $("#fq_confirm_info").text("二级奖励积分设置不能为空，请重新设置");
                    $('#fq_confirm').modal();
                    return false;
                }
			
                if(!$('.reward_limit').val().match(pos_int)||$('.reward_limit').val()==''){
                    $("#fq_confirm_info").text("奖励上限不能为空或者设置格式不对，请重新设置");
                    $('#fq_confirm').modal();
                    return false;
                }
				
				if(!$('.people_limit').val().match(pos_int)||$('.people_limit').val()=='' ){
					$("#fq_confirm_info").text("邀请人数上限不能为空或者设置格式不对，请重新设置");
                    $('#fq_confirm').modal();
                    return false;
					
				}*/
				
                var op =/^-[1-9]d*|0$/;
                if(!$('.action_cancel_val').val().match(op)||$('.action_cancel_val').val()==''){
                    $("#fq_confirm_info").text("扣除上级积分必须为负整数或0，请重新设置");
                    $('#fq_confirm').modal();
                    return false;
                }
				if(parseInt($('.action_cancel_val').val()) > 0){
						$("#fq_confirm_info").text("扣除上级积分必须为负整数或0，请重新设置");
						$('#fq_confirm').modal();
						return false;
				}
				
				if(!$('.cancel_highest_val').val().match(op) || $('.cancel_highest_val')==''){
					$("#fq_confirm_info").text("扣除上上级积分必须为负整数或0，请重新设置");
                    $('#fq_confirm').modal();
                    return false;
					
				}
				
			if(parseInt($('.cancel_highest_val').val()) > 0){
						$("#fq_confirm_info").text("扣除上级积分必须为负整数或0，请重新设置");
						$('#fq_confirm').modal();
						return false;
				}
				/*
                if($(".cancel_tips_val").val()==''){
                    $("#fq_confirm_info").text("通知上级提示语不能为空，请重新输入");
                    $('#fq_confirm').modal();
                    return false;
                }
					
                if($(".attention_tips_val").val()==''){
                    $("#fq_confirm_info").text("首次关注提示语不能为空，请重新输入");
                    $('#fq_confirm').modal();
                    return false;
                }
				
				if($('.inv_rules').val()==''){
						 $("#fq_confirm_info").text("规则内容不能为空，请重新输入");
                         $('#fq_confirm').modal();
                        return false;	
					}
					 
                if($(".superiors_tips_val").val()==''){
                    $("#fq_confirm_info").text("通知上级提示语不能为空，请重新输入");
                    $('#fq_confirm').modal();
                    return false;
                }
			
                if($('input:radio[name="docInlineRadio"]:checked').val()==1){
                    if($('.seconds_val').val().match(format_1)||$('.seconds_val').val()==''){
                        $("#fq_confirm_info").text("防作弊的时间设置必须为正整数，请重新设置");
                        $('#fq_confirm').modal();
                        return false;
                    }
			
                    if($('.user_num').val().match(format_1)||$('.user_num').val()==''){
                        $("#fq_confirm_info").text("防作弊的用户不能为空，上限必须为正整数，请重新设置");
                        $('#fq_confirm').modal();
                        return false;
                    }
				
                    if($(".openid_val").val()==''){
                        $("#fq_confirm_info").text("OPENID不能为空，请重新输入");
                        $('#fq_confirm').modal();
                        return false;
                    }
                }*/
            },
		
            success:function(data){
                if(data.info==1){
                    $("#fq_confirm_info").text("设置成功");
                    $('#fq_confirm').modal();
                }
				if(data.info == -1){
                    $("#fq_confirm_info").text("数据传输异常,设置失败");
                    $('#fq_confirm').modal();
                }
            }
        })


    })
	
		$('.give_up_save').click(function(){		
			$("#fq_true_confirm_info").text("你确定要重置数据吗");		
			$('#fq_true_confirm').modal({				
						onConfirm: function(options) {					
							$.ajax({						
								url:"/wxinvite/rest_default.html",												
								type:"get",												
								data:{'del':1},												
								success:function(data){							
									if(data.info == 1){								
											window.location.reload();							
											}						
										}					
									});				
								}			
							})	
						});			
	/*上传海报图*/
	$('.upload_poster').click(function(){
	
		$('#upload_input').click();
		
	});	
	
	$('.poster_ul').on('mouseover','.am-padding-sm',function(){
		$(this).children('.am-gallery-item').children('.cover_item').css("opacity","0.5");
	});
	
	$('.poster_ul').on('mouseout','.am-padding-sm',function(){
	
		$(this).children('.am-gallery-item').children('.cover_item').css("opacity","0");
		
	});
	
	
	
	
	
	$('#upload_input').change(function(){
		$('.loading').show();
		
		
		$('#imageUpload').ajaxSubmit({
			dataType:'json',
			success:function(data){			
					if(data.status == 1){
						$('.loading').before('<li class="am-padding-sm custom_poster_li custom_poster_'+data.poster_id+'"><div class="am-gallery-item" style="display: inline"><a href="'+data.poster_path+'" class=""><img src="'+data.poster_path+'" alt="海报预览" /></a><div class="cover_item" style="opacity:0;"><i class="del_icon delImg" data-id="'+data.poster_id+'"></i></div></div><div class="am-radio-inline am-round" style="top:-15px;"><label><input type="radio" name="doc-radio-1" data-id="'+data.poster_id+'" value="7" style="height: 15px; width: 15px;" class="type_def"><span class="am-margin-left-xs custom_poster pid_'+data.poster_id+'" >自定义海报</span><a class="am-icon-edit am-margin-left-xs poster_note_edit am-secondary" data-note="自定义海报" data-id="'+data.poster_id+'" href="javascript: void(0)"></a></label></div></li>');
						$('.loading').hide();
					}else{
						$('.loading').hide();
						$("#fq_confirm_info").text(data.info);
						$('#fq_confirm').modal();
					}	
			},
			error:function(){
				$('.loading').hide();
				$("#fq_confirm_info").text("上传失败，请尝试更换图片！");
				$('#fq_confirm').modal();
			}
		});
	});
	
	/*删除自定义图片*/
	$('.poster_ul').on('click','.del_icon',function(){
	
		var checked_id = $('input:radio[name="doc-radio-1"]:checked').attr('data-id');

		$("#fq_true_confirm_info").text("你确定要删除这张海报吗");	
		$("#fq_true_confirm").modal({
			relatedTarget: this,
			onConfirm: function(options) {
			var poster_id = $(this.relatedTarget).attr('data-id');
			
				$.ajax({
					url:"/wxinvite/del_poster.html",
					data:{'poster_id': poster_id},
					type:'post',
					success:function(data){
						if(data.info ==1){
							
							
							if(checked_id == poster_id){
								
								$('.first_poster').prop('checked',true);
							}
							$('.custom_poster_'+poster_id).remove();
							
							//当前域名
							var local = window.location.host;
							var remove_src = 'http://'+local +'/'+ data.poster_path;
							
							var length = $('.am-pureview-slider li').length;
							for(var i = 0;i< length;i++){
								
								if($('.am-pureview-slider li').eq(i).attr('data-src') == remove_src){
								
									$('.am-pureview-slider li').eq(i).remove();
								}
							}
							$("#fq_confirm_info").text("删除成功");
							$('#fq_confirm').modal();
						}
					}
				})
			}
		});
	});
	
	/*修改海报名称*/
	
	$('.poster_ul').on('click','.poster_note_edit',function(){
		var poster_name = $(this).attr('data-note');
		var poster_id = $(this).attr('data-id');
		$('.confirm_save_name').attr('data-id',poster_id);
		$('.new_poster_name').val(poster_name);
		$('.new_poster_name').attr('data-id',poster_id);
		$('#edit_poster').modal();
	});
	
	$('.confirm_save_name').click(function(){
		 $('.confirm_save_name').ajaxSubmit({
			type:'post',
            url:"/wxinvite/edit_poster_name.html",
			data:{'poster_id':$('.new_poster_name').attr('data-id'),'poster_name':$('.new_poster_name').val()},
			beforeSubmit:function(){
				if($('.new_poster_name').val() == ''){
					
					$('.edit_lose').text('海报名称不能空，请重新输入');
					$('#edit_lose_alert').modal({
						
						onConfirm: function(options){
								$("#edit_poster").modal();
						},
					});
					return false;
				}
			},
			success:function(data){
				if(data.info == 1){
					$("#fq_confirm_info").text("修改成功");
					$('.pid_'+data.id).text(data.name);
					$('#fq_confirm').modal();
				}	
			}
		 })
	});
	
	//下载模板
	$('.download_template').click(function(){
		
		window.location.href ="/wxinvite/download.html";
	});
</script>
